<template>
  <div>
    <div>count:{{ this.count }}</div>
    <div>
      <el-button type="primary" @click="countclick">登录</el-button>
    </div>
  </div>
</template>

<script>
import { mapState, mapStores, mapActions } from "pinia";
import { useUserStore } from "@/stores/user.js";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapStores(useUserStore),
    ...mapState(useUserStore, ["count"]),
  },
  methods: {
    // 允许读取 this.increment()
    ...mapActions(useUserStore, ["increment"]),
    countclick() {
      this.increment();
    },
  },
};
</script>

<style lang="scss" scoped></style>
